// Author: Lutongli
// Email: 2119084416@qq.com
// Date: 2025-03-16
// Description: Main entry file

// 项目总入口

package main

import (
	"fmt"
	"gin_project/config"
	_ "gin_project/config"
	"gin_project/middlewares"
	"gin_project/routers"
	"gin_project/utils/jwt"
	"gin_project/utils/logs"

	"github.com/gin-gonic/gin"
)

func main() {
	/*
		1.加载配置文件
		2.加载gin框架



	*/
	logs.Info(nil, "程序启动成功")
	//测试生产jwt toekn
	token, err := jwt.GenToken("lutongli")
	fmt.Println(token, err)
	cc, _ := jwt.ParseToken(token)
	fmt.Printf("%v\n", cc)
	r := gin.Default()
	r.Use(middlewares.JwtAuth)
	routers.RegisterRouters(r)
	if err := r.Run(config.Port); err != nil {
		panic(err)
	}

}
